/**
 *
 */
package com.angel.mocks.dao.generic;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.angel.architecture.persistence.base.PersistentObject;

/**
 * @author William
 *
 */
@Entity
public class Course extends PersistentObject{

	private static final long serialVersionUID = -1649939027658119050L;
	@ManyToOne(optional = false, cascade = CascadeType.ALL)
	private Teacher teacher;
	@OneToMany(cascade = CascadeType.ALL)
	private List<Person> persons;

	public Course(){
		super();
	}

	/**
	 * @return the teacher
	 */
	public Teacher getTeacher() {
		return teacher;
	}

	/**
	 * @param teacher the teacher to set
	 */
	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	public Course(List<Person> persons){
		super();
		this.persons = persons;
	}

	public List<Person> getAllPersons(){
		return this.persons;
	}

	/**
	 * @return the persons
	 */
	public List<Person> getPersons() {
		return persons;
	}

	/**
	 * @param persons the persons to set
	 */
	public void setPersons(List<Person> persons) {
		this.persons = persons;
	}
}
